package com.example.service;

import com.example.pojo.Person;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @author およそ神
 * @version JDK 1.8
 */
//@Component
//@FeignClient:微服务客户端注解,value:指定微服务的名字,这样就可以使Feign客户端直接找到对应的微服务
//@FeignClient(value = "SPRINGCLOUD-PROVIDER-PERSON",fallbackFactory = PersonClientServiceFallBackFactory.class)//fallbackFactory指定降级配置类
public interface PersonClientService {

    @PostMapping("/addPerson")
    Boolean addPerson(Person person);

    @GetMapping("/searchById/{id}")
    Person searchById(@PathVariable("id")Integer id);

    @GetMapping("/searchAll")
    List<Person> searchAll();
}
